import Vue from 'vue'
import App from './App'
import router from './router'
import './assets/css/global.css'
import less from 'less'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// import {Button,Form,FormItem,Input,Message,Container,Header,
// Aside,Main,Menu,Submenu,MenuItem,Breadcrumb,BreadcrumbItem,Card,Row,Col,
//  Table,TableColumn,Switch,Tooltip,Pagination,Dialog,MessageBox,Tag } from 'element-ui';
//导入字体图标
import './assets/fonts/iconfont.css'

import axios from 'axios'
import ZkTable from 'vue-table-with-tree-grid'

//导入NProgress   对应的JS以及CSS
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

Vue.use(ElementUI);

//配置请求根路径
axios.defaults.baseURL = 'http://47.108.206.212:9999/api/private/v1/'
//在request 拦截器中，展示进度条   NProgress.start()

//请求拦截
axios.interceptors.request.use(config => {
  //为请求头对象，添加Token验证的Authorization字段
  console.log(config)
  NProgress.start()

  config.headers.Authorization = window.sessionStorage.getItem('token')
   NProgress.done()
  return config
})

//在response 拦截器中，隐藏进度条  NProgress.done()
axios.interceptors.response.use(config => {
  return config
})

Vue.prototype.$http  = axios
// Vue.prototyp.$confirm = MessageBox.confirm


//关闭vue的生产提示
Vue.config.productionTip = false

/* eslint-disable no-new */
//创建vue示例对象
new Vue({
  el: '#app',
  router,
  render: h => h(App)    //将APP组件放入容器中
}).$mount('#app')
